package cn.shadow.aop;

import cn.shadow.aop.advisor.Advisor;
import cn.shadow.beans.BeanFactory;

import java.util.List;

/**
 * @author 冯啸迪
 */
public interface AopProxyFactory {

    /**
     * 获取代理
     * @param object 实际对象
     * @param beanName Bean名称
     * @param advisorList 切面列表
     * @param beanFactory Bean工厂
     * @return 返回代理
     * @throws Throwable 抛出异常
     */
    AopProxy getAopProxy(Object object, String beanName, List<Advisor> advisorList, BeanFactory beanFactory) throws Throwable;

    /**
     * 返回一个默认的代理工厂
     * @return
     */
    static AopProxyFactory getDefaultAopProxyFactory(){
        return new DefaultAopProxyFactory();
    }

}
